package org.dromara.Nyt7StatisticsInsureSubCompany.controller;

import java.util.List;

import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.Nyt7StatisticsInsureSubCompany.domain.vo.Nyt7StatisticsInsureSubCompanyVo;
import org.dromara.Nyt7StatisticsInsureSubCompany.domain.bo.Nyt7StatisticsInsureSubCompanyBo;
import org.dromara.Nyt7StatisticsInsureSubCompany.service.INyt7StatisticsInsureSubCompanyService;
import org.dromara.common.mybatis.core.page.TableDataInfo;

/**
 * 统计分析_投保统计_数量统计_按保险公司的数量统计
 *
 * @author yt
 * @date 2025-01-06
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/Nyt7StatisticsInsureSubCompany/Nyt7StatisticsInsureSubCompany")
public class Nyt7StatisticsInsureSubCompanyController extends BaseController {

    private final INyt7StatisticsInsureSubCompanyService nyt7StatisticsInsureSubCompanyService;

    /**
     * 查询统计分析_投保统计_数量统计_按保险公司的数量统计列表
     */
    @SaCheckPermission("Nyt7StatisticsInsureSubCompany:Nyt7StatisticsInsureSubCompany:list")
    @GetMapping("/list")
    public TableDataInfo<Nyt7StatisticsInsureSubCompanyVo> list(Nyt7StatisticsInsureSubCompanyBo bo, PageQuery pageQuery) {
        return nyt7StatisticsInsureSubCompanyService.queryPageList(bo, pageQuery);
    }

    /**
     * 导出统计分析_投保统计_数量统计_按保险公司的数量统计列表
     */
    @SaCheckPermission("Nyt7StatisticsInsureSubCompany:Nyt7StatisticsInsureSubCompany:export")
    @Log(title = "统计分析_投保统计_政策性补贴统计_按保险公司统计", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(Nyt7StatisticsInsureSubCompanyBo bo, HttpServletResponse response) {
        List<Nyt7StatisticsInsureSubCompanyVo> list = nyt7StatisticsInsureSubCompanyService.queryList(bo);
        ExcelUtil.exportExcel(list, "统计分析_投保统计_政策性补贴统计_按保险公司统计", Nyt7StatisticsInsureSubCompanyVo.class, response);
    }

}
